//
//  LogOutView.m
//  FKGW
//
//  Created by song ce on 2017/2/17.
//  Copyright © 2017年 song ce. All rights reserved.
//

#import "LogOutView.h"
#import "RegisterViewController.h"
#import "LoginViewController.h"

@implementation LogOutView
- (void)awakeFromNib {
    [super awakeFromNib];
    self.backgroundColor =[UIColor clearColor];
    // Initialization code
}


- (IBAction)login:(id)sender {
    LoginViewController *loginVC = [[LoginViewController alloc]init];
    loginVC.isModel = YES;
    loginVC.hidesBottomBarWhenPushed= YES;
    loginVC.vcName = @"登陆";
//    [[self secondNavigationController]
//     pushViewController:loginVC animated:YES];
    BaseNavigationViewController *baseNavi = [[BaseNavigationViewController alloc]initWithRootViewController:loginVC];
    [[self baseViewController] presentViewController:baseNavi animated:YES completion:nil];
}

- (IBAction)register:(id)sender {
    RegisterViewController *registerVC = [[RegisterViewController alloc]init];
    registerVC.hidesBottomBarWhenPushed= YES;
    registerVC.vcName = @"注册";
    registerVC.isModel = YES;
    BaseNavigationViewController *baseNavi = [[BaseNavigationViewController alloc]initWithRootViewController:registerVC];
//    [[self secondNavigationController]
//     pushViewController:registerVC animated:YES];
    
    [[self baseViewController] presentViewController:baseNavi animated:YES completion:nil];
}

- (BaseNavigationViewController*)secondNavigationController{
    UIResponder *next = self.nextResponder;
    while (next!=nil) {
        if([next isKindOfClass:[BaseNavigationViewController class]]){
            return (BaseNavigationViewController*)next;
        }
        next = next.nextResponder;
    }
    return nil;
}
- (BaseViewController*)baseViewController{
    UIResponder *next = self.nextResponder;
    while (next!=nil) {
        if([next isKindOfClass:[BaseViewController class]]){
            return (BaseViewController*)next;
        }
        next = next.nextResponder;
    }
    return nil;
}



@end
